home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / crayola / common / crayInst.c < prev    next >
C/C++ Source or Header  |  1993-01-12  |  6KB  |  166 lines

  1. #include "geom.h"
  2. #include "instP.h"
  3. #include "crayolaP.h"
  4.  
  5. void *cray_inst_HasColor(int sel, Geom *geom, va_list args);
  6. void *cray_inst_HasVColor(int sel, Geom *geom, va_list args);
  7. void *cray_inst_HasFColor(int sel, Geom *geom, va_list args);
  8.  
  9. void *cray_inst_CanUseVColor(int sel, Geom *geom, va_list args);
  10. void *cray_inst_CanUseFColor(int sel, Geom *geom, va_list args);
  11.  
  12. void *cray_inst_UseVColor(int sel, Geom *geom, va_list args);
  13. void *cray_inst_UseFColor(int sel, Geom *geom, va_list args);
  14.  
  15. void *cray_inst_EliminateColor(int sel, Geom *geom, va_list args);
  16.  
  17. void *cray_inst_SetColorAll(int sel, Geom *geom, va_list args);
  18. void *cray_inst_SetColorAt(int sel, Geom *geom, va_list args);
  19. void *cray_inst_SetColorAtV(int sel, Geom *geom, va_list args);
  20. void *cray_inst_SetColorAtF(int sel, Geom *geom, va_list args);
  21.  
  22. void *cray_inst_GetColorAt(int sel, Geom *geom, va_list args);
  23. void *cray_inst_GetColorAtV(int sel, Geom *geom, va_list args);
  24. void *cray_inst_GetColorAtF(int sel, Geom *geom, va_list args);
  25.  
  26. #define MAX_METHODS 14
  27.  
  28. static craySpecFunc methods[] = {
  29.   "crayHasColor", cray_inst_HasColor,
  30.   "crayHasVColor", cray_inst_HasVColor,
  31.   "crayHasFColor", cray_inst_HasFColor,
  32.   
  33.   "crayCanUseVColor", cray_inst_CanUseVColor,
  34.   "crayCanUseFColor", cray_inst_CanUseFColor,
  35.   
  36.   "crayUseVColor", cray_inst_UseVColor,
  37.   "crayUseFColor", cray_inst_UseFColor,
  38.   
  39.   "crayEliminateColor", cray_inst_EliminateColor,
  40.   
  41.   "craySetColorAll", cray_inst_SetColorAll,
  42.   "craySetColorAt", cray_inst_SetColorAt,
  43.   "craySetColorAtV", cray_inst_SetColorAtV,
  44.   "craySetColorAtF", cray_inst_SetColorAtF,
  45.   
  46.   "crayGetColorAt", cray_inst_GetColorAt,
  47.   "crayGetColorAtV", cray_inst_GetColorAtV,
  48.   "crayGetColorAtF", cray_inst_GetColorAtF
  49.   };
  50.  
  51. cray_inst_init() {
  52.   crayInitSpec(methods, MAX_METHODS, GeomClassLookup("inst"));
  53.   return 0;
  54. }
  55.  
  56. void *cray_inst_HasColor(int sel, Geom *geom, va_list args) {
  57.   int *gpath = va_arg(args, int *);
  58.   return (void *)(crayHasColor(((Inst *)geom)->geom, 
  59.                    gpath == NULL ? NULL : gpath + 1));
  60. }
  61.  
  62. void *cray_inst_HasVColor(int sel, Geom *geom, va_list args) {
  63.   int *gpath = va_arg(args, int *);
  64.   return (void *)(crayHasVColor(((Inst *)geom)->geom, 
  65.                 gpath == NULL ? NULL : gpath + 1));
  66. }
  67.  
  68. void *cray_inst_HasFColor(int sel, Geom *geom, va_list args) {
  69.   int *gpath = va_arg(args, int *);
  70.   return (void *)(crayHasFColor(((Inst *)geom)->geom, 
  71.                 gpath == NULL ? NULL : gpath + 1));
  72. }
  73.  
  74. void *cray_inst_CanUseVColor(int sel, Geom *geom, va_list args) {
  75.   int *gpath = va_arg(args, int *);
  76.   return (void *)(crayCanUseVColor(((Inst *)geom)->geom, 
  77.                    gpath == NULL ? NULL : gpath + 1));
  78. }
  79.  
  80. void *cray_inst_CanUseFColor(int sel, Geom *geom, va_list args) {
  81.   int *gpath = va_arg(args, int *);
  82.   return (void *)(crayCanUseFColor(((Inst *)geom)->geom,
  83.                    gpath == NULL ? NULL : gpath + 1));
  84. }
  85.   
  86.  
  87. void *cray_inst_UseVColor(int sel, Geom *geom, va_list args) {
  88.   ColorA *c = va_arg(args, ColorA *);
  89.   int *gpath = va_arg(args, int *);
  90.   return (void *)(crayUseVColor(((Inst *)geom)->geom, c, 
  91.                 gpath == NULL ? NULL : gpath + 1));
  92. }
  93.  
  94. void *cray_inst_UseFColor(int sel, Geom *geom, va_list args) {
  95.   ColorA *c = va_arg(args, ColorA *);
  96.   int *gpath = va_arg(args, int *);
  97.   return (void *)(crayUseFColor(((Inst *)geom)->geom, c, 
  98.                 gpath == NULL ? NULL : gpath + 1));
  99. }
  100.  
  101. void *cray_inst_EliminateColor(int sel, Geom *geom, va_list args) {
  102.   int *gpath = va_arg(args, int *);
  103.   return (void *)(crayEliminateColor(((Inst *)geom)->geom, 
  104.                      gpath == NULL ? NULL : gpath + 1));
  105. }
  106.  
  107. void *cray_inst_SetColorAll(int sel, Geom *geom, va_list args) {
  108.   ColorA *c = va_arg(args, ColorA *);
  109.   int *gpath = va_arg(args, int *);
  110.   return (void *)(craySetColorAll(((Inst *)geom)->geom, c, 
  111.                   gpath == NULL ? NULL : gpath + 1));
  112. }
  113.      
  114. void *cray_inst_SetColorAt(int sel, Geom *geom, va_list args) {
  115.   ColorA *c = va_arg(args, ColorA *);
  116.   int vindex = va_arg(args, int), findex = va_arg(args, int), 
  117.   *edge = va_arg(args, int *), *gpath = va_arg(args, int *);
  118.   HPoint3 *pt = va_arg(args, HPoint3 *);
  119.   return (void *)(craySetColorAt(((Inst *)geom)->geom, c, vindex, 
  120.                  findex, edge, 
  121.                  gpath == NULL ? NULL : gpath + 1, pt));
  122. }
  123.  
  124. void *cray_inst_SetColorAtV(int sel, Geom *geom, va_list args) {
  125.   ColorA *c = va_arg(args, ColorA *);
  126.   int index = va_arg(args, int), *gpath = va_arg(args, int *);
  127.   HPoint3 *pt = va_arg(args, HPoint3 *);
  128.   return (void *)(craySetColorAtV(((Inst *)geom)->geom, c, index, 
  129.                   gpath == NULL ? NULL : gpath + 1,
  130.                   pt));
  131.  
  132. }
  133.  
  134. void *cray_inst_SetColorAtF(int sel, Geom *geom, va_list args) {
  135.   ColorA *c = va_arg(args, ColorA *);
  136.   int index = va_arg(args, int), *gpath = va_arg(args, int *);
  137.   return (void *)(craySetColorAtF(((Inst *)geom)->geom, c, index, 
  138.                   gpath == NULL ? NULL : gpath + 1));
  139.  
  140. }
  141.  
  142. void *cray_inst_GetColorAt(int sel, Geom *geom, va_list args) {
  143.   Geom *newgeom = ((Inst *)geom)->geom;
  144.   ColorA *c = va_arg(args, ColorA *);
  145.   int vindex = va_arg(args, int), findex = va_arg(args, int), 
  146.   *edge = va_arg(args, int *), *gpath = va_arg(args, int *);
  147.   HPoint3 *pt = va_arg(args, HPoint3 *);
  148.   return (void *)(crayGetColorAt(newgeom, c, vindex, findex, edge, 
  149.                  gpath == NULL ? NULL : gpath + 1, pt));
  150. }
  151.  
  152. void *cray_inst_GetColorAtV(int sel, Geom *geom, va_list args) {
  153.   ColorA *c = va_arg(args, ColorA *);
  154.   int index = va_arg(args, int), *gpath = va_arg(args, int *);
  155.   HPoint3 *pt = va_arg(args, HPoint3 *);
  156.   return (void *)(crayGetColorAtV(((Inst *)geom)->geom, c, index, 
  157.                   gpath == NULL ? NULL : gpath + 1, pt));
  158. }
  159.  
  160. void *cray_inst_GetColorAtF(int sel, Geom *geom, va_list args) {
  161.   ColorA *c = va_arg(args, ColorA *);
  162.   int index = va_arg(args, int), *gpath = va_arg(args, int *);
  163.   return (void *)(crayGetColorAtF(((Inst *)geom)->geom, c, index, 
  164.                   gpath == NULL ? NULL : gpath + 1));
  165. }
  166.